using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MediaPortal.Search
{
    public partial class FormGlobalSearchSettings : Form
    {
        protected GlobalSearchSettings globalSearchSettings;

        public FormGlobalSearchSettings()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void FormGlobalSearchSettings_Load(object sender, EventArgs e)
        {
            GlobalSearchSettings.Instance().LoadFromFile();
            this.globalSearchSettings = GlobalSearchSettings.Instance();
            
            if (globalSearchSettings.KeyboardType == KeyboardType.NormalVirtualKeyboard)
            {
                rdbtnDefaultKeyboard.Checked = true;
            }
            if (globalSearchSettings.KeyboardType == KeyboardType.SMSVirtualKeyboard)
            {
                rdbtnSMSKeyboard.Checked = true;
            }

            lblVersion.Text = GlobalSearchConstants.Version;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            globalSearchSettings.SaveToFile();
            Close();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void rdbtnDefaultKeyboard_CheckedChanged(object sender, EventArgs e)
        {
            globalSearchSettings.KeyboardType = KeyboardType.NormalVirtualKeyboard;
        }

        private void rdbtnSMSKeyboard_CheckedChanged(object sender, EventArgs e)
        {
            globalSearchSettings.KeyboardType = KeyboardType.SMSVirtualKeyboard;
        }
    }
}